﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace win_Calculater
{
    public partial class Form1 : Form
    {
        int Lnum, Rnum;
        public Form1()
        {
            InitializeComponent();
        }

        private void num1_TextChanged(object sender, EventArgs e)
        {
            Lnum = Convert.ToInt32(num1.Text);
        }

        private void operater_SelectedIndexChanged(object sender, EventArgs e)
        {
        }

        private void num2_TextChanged(object sender, EventArgs e)
        {
            Rnum = Convert.ToInt32(num2.Text);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            switch(operater.Text)
            {
                case "+":
                    {
                        answer.Text = Convert.ToString(Lnum+Rnum);
                        break;
                    }
                case "-":
                    {
                        answer.Text = Convert.ToString(Lnum - Rnum);
                        break;
                    }
                case "*":
                    {
                        answer.Text = Convert.ToString(Lnum * Rnum);
                        break;
                    }
                case "/":
                    {
                        answer.Text = Convert.ToString(Lnum / Rnum);
                        break;
                    }
                case "%":
                    {
                        answer.Text = Convert.ToString(Lnum % Rnum);
                        break;
                    }
                default:break;
            }
        }
    }
}
